import request from '@/utils/request'
// mock+api示例。后端接口路径/api/type/list，mock路径/type/list。

// 查询产品类别列表
export function listCategory(query) {
  return request({
    url: '/api/category/list',
    method: 'get',
    params: query
  })
}

// 查询产品类别
export function getCategory(categoryId) {
  return request({
    url: '/api/category/' + categoryId,
    method: 'get'
  })
}

// 新增产品类别
export function addCategory(data) {
  return request({
    url: '/api/category',
    method: 'post',
    data: data
  })
}

// 修改产品类别
export function updateCategory(data) {
  return request({
    url: '/api/category',
    method: 'put',
    data: data
  })
}

// 删除产品类别
export function deleteCategory(categoryId) {
  return request({
    url: '/api/category/delete/' + categoryId,
    method: 'delete'
  })
}
